package com.ziyun.erp.web.modules.goods.controller;


import com.ziyun.erp.modules.goodsMonitor.annotation.CustomAnnotation;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.annotation.Annotation;

public class GoodsHandlerInterceptor implements HandlerInterceptor {

    //进入Handler方法之后，返回modelAndView之前执行
    //应用场景从modelAndView出发：将公用的模型数据(比如菜单导航)在这里传到视图，也可以在这里统一指定视图
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        Class<?> aClass = handler.getClass();
        CustomAnnotation annotation = aClass.getAnnotation(CustomAnnotation.class);
        if(annotation != null && (annotation.openMonitoring())){
            //该方法需要被日志监控


        }


    }



}
